<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>

		<style>
			#div_0 {
				width: 500px;
				height: 300px;
				margin: 0 auto;
				text-align: center;
				position: relative;
			}

			#div_0 img {
				width: 500px;
				height: 300px;
			}

			ul {
				display: flex;
				justify-content: space-between;
				width: 300px;
				height: 30px;
				position: absolute;
				bottom: 0;
				left: 0;
				list-style: none;
			}

			ul li {
				width: 20px;
				height: 20px;
				background-color: rgba(225, 225, 225, 0.661);
				border-radius: 50%;
			}

			.active {
				background-color: aqua;
			}
		</style>
		<script>
			var index = 0;
			var list = document.querySelectorAll("ul li");

			function changePic() {
				var arr = ["https://assets.bdqn.cn/upload/ad/1657591998577142.jpg?1670373259",
					"https://assets.bdqn.cn/upload/ad/1621998059577218.jpg?1670373259",
					"https://assets.bdqn.cn/upload/ad/1629342871611283.jpg?1670373259",
					"https://assets.bdqn.cn/upload/ad/1602732891510692.png?1670373259",
					"https://assets.bdqn.cn/upload/ad/1590995842903068.jpg?1670373259"
				];
				
				var img = document.querySelector("#div_0 img");
				
				img.src = arr[index];
				
				var list = document.querySelectorAll("ul li");
				
				
				for (var i = 0; i < list.length; i++) {
					list[i].classList.remove("active");
				}

				list[index].classList.add("active");
				list[index].onmouseover = function() {
					clearInterval(time);
					console.log(1);
				}
				list[index].onmouseout = function(event) {
					time = setInterval(changePic, 1000);
					event.stopPropagation();
				}
			
				index++;
				if (index > 4) {
					index = 0;
				}
			}
			var time = setInterval(changePic, 1000);
		</script>

	</head>
	<body>
		<div id="div_0">
			<img src="https://assets.bdqn.cn/upload/ad/1657591998577142.jpg?1670373259" alt="">
			<ul>
				<li class="active"></li>
				<li></li>
				<li></li>
				<li></li>
				<li></li>
			</ul>
		</div>
	</body>
</html>
